package com.iwms.manage.controller;


import com.iwms.common.core.domain.AjaxResult;
import com.iwms.manage.domain.TaskNumber;
import com.iwms.manage.domain.dto.ReplenishCountOption;
import com.iwms.manage.domain.dto.ShipDistributionOption;
import com.iwms.manage.service.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/manage/statistic")
public class StatisticController {
    @Autowired
    private StatisticService statisticService;

    /**
     * 工单数量统计
     */
    @GetMapping("/taskNum")
    public AjaxResult getTaskNum(){
        TaskNumber taskNumber = statisticService.getTaskNum();
        return AjaxResult.success(taskNumber);
    }

    /**
     * 合作商统计
     */
    @GetMapping("/partnerData")
    public AjaxResult getPartnerCount(){
        List<Map<String,Object>> partnerList = statisticService.countPartnerData();

        return AjaxResult.success(partnerList);
    }
    /**
     * 统计热销出货商品
     */
    @GetMapping("/skuShipData")
    public AjaxResult getShipNum(){
        List<Map<String,Object>> shipNumList = statisticService.countShipNum();

        return AjaxResult.success(shipNumList);
    }
    /**
     * 统计运营运维员工
     */
    @GetMapping("/empNumData")
    public AjaxResult getEmpData(){
        List<Map<String,Object>> empNumList = statisticService.countEmpNumData();
        return AjaxResult.success(empNumList);

    }
    /**
     * 统计补货数量
     */
    @GetMapping("/replenishNumData")
    public AjaxResult getReplenishNumData(){
        ReplenishCountOption replenishNumList = statisticService.countReplenishNumData();
        return AjaxResult.success(replenishNumList);

    }

    /**
     * 统计补货数量
     */
    @GetMapping("/shipNumData")
    public AjaxResult getShipNumData(){
        ShipDistributionOption shipNumList = statisticService.countShipNumData();
        return AjaxResult.success(shipNumList);

    }


}
